Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 3 - Endpoints / Endpoints Reference
Constants and Data Types


The OTData Structure

You use the OTData structure to specify the location and size of noncontiguous data. You can use this structure in place of the normal TNetbuf structure to describe a data buffer when sending data using the OTSndUData function (page 3-101), the OTSndURequest function (page 3-107), the OTSndUReply function (page 3-112), the OTSnd function (page 3-130), the OTSndRequest function (page 3-137), and the OTSndReply function (page 3-141).

WARNING
The OTData structure is an Apple extension to the XTI specification. Using it might cause your program not to work when ported to other XTI/STREAMS environments.
When transferring data, you normally specify a pointer to a TNetbuf structure that specifies the location and size of the buffer containing the data. However, you cannot use a TNetbuf structure to describe data that is noncontiguous. Instead you must use an OTData structure to describe each separate chunk of data. When the function that sends the data executes, it is able to locate all
the chunks of data, given a pointer to the OTData structure that describes the first chunk.

Using the OTData structure enables you to send data that is not contiguous, but the total size of the data fragments must not exceed the maximum size of data that the endpoint can send. The limits for normal and expedited data are specified in the tsdu and etsdu fields of the TEndpointInfo structure for the endpoint.

Each OTData structure specifies the location of a data fragment, the size of the fragment, and the location of the OTData structure that specifies the location and size of the next data fragment. The data information structure is defined by the OTData type.

struct OTData {
   void*    fNext;
   void*    fData;
   size_t   fLen;
};
typedef struct OTData OTData;
Field Description
fNext
A pointer to the OTData structure that describes the next data fragment. Specify a NULL pointer for the last data fragment.
fData
A pointer to the data fragment.
fLen
A long specifying the size of the fragment in bytes.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996